﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Roteirizacao.Master" CodeBehind="Motoristas.aspx.cs" Inherits="Roteirização.Motoristas" %>
<%--
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>

<head>
  <title>:::::: Miranda Transportes :::::</title>
  <meta name="description" content="website description" />
  <meta name="keywords" content="website keywords, website keywords" />
  <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
  <link rel="stylesheet" type="text/css" href="css/style.css" />
  <!-- modernizr enables HTML5 elements and feature detects -->
  <script type="text/javascript" src="js/modernizr-1.5.min.js"></script>
  <script type="text/javascript" src="js/Grid.js"></script>

        <%--<link href="css/jquery.css" rel="stylesheet" type="text/css" />
</head>

<body onload="CarregaGrid();">
<div id="data-grid-local"></div>
  <div id="main">
    <header>
      <div id="logo">
        <div id="logo_text">
          <!-- class="logo_colour", allows you to change the colour of the text -->
          <h1><a href="index.aspx"><span class="logo_colour">Miranda</span>Transporte</a></h1>
          <h2>Sistema de Roteirização.</h2>
        </div>
      </div>
      <nav>
        <div id="menu_container">
          <ul class="sf-menu" id="nav">
            <li><a href="index.aspx">Home</a></li>
            <li><a href="#">Cadastros</a>
               <ul>
                <li><a href="Motoristas.aspx">Motoristas</a></li>
                <li><a href="Veiculos.aspx">Veiculos</a></li>
                <li><a href="Empresas.aspx">Clientes</a></li>
                <li><a href="Entregas.aspx">Entregas</a></li>
              </ul>
            </li>      
            
            <li><a href="#">Processa</a></li>
            <li><a href="#">Roteiros</a></li>

          </ul>
        </div>
      </nav>
    </header>
    <div id="site_content">
      <div class="content">
        <h2>Cadastro Motorista</h2>
        <form action="#" method="post" runat="server">

                  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
        <script type="text/javascript" src="js/jquery.ui.datagrid.min.js"></script>
          <div class="form_settings">
            <p><span>Nome:</span><input type="text" id="txtNome" name="txtNome" value="" runat="server" /></p>
            <p><span>RG:</span><input id="txtRG" type="text" name="txtNome" value="" runat="server" /></p>
            <p><span>CPF:</span><input id="txtCPF" type="text" name="txtNome" value="" runat="server" /></p>
            <p><span>CNH:</span><input id="txtCNH" type="text" name="txtNome" value="" runat="server" /></p>
            <p><span>CNH Cat.:</span><input id="txtCatCNH" type="text" name="txtNome" value="" runat="server" /></p>
            <p><span>Rua:</span><input id="txtRuaM" type="text" name="txtNome" value="" runat="server" /></p>
            <p><span>Nº:</span><input id="txtNumM" type="text" name="txtNome" value="" runat="server" /></p>
            <p><span>Complemento:</span><input id="txtCompM" type="text" name="txtNome" value="" runat="server" /></p>
            <p><span>Bairro:</span><input id="txtBairroM" type="text" name="txtNome" value="" runat="server" /></p>
            <p><span>Cidade:</span><input id="txtCidadeM" type="text" name="txtNome" value="" runat="server" /></p>
            <p><span>Estado:</span><input id="txtEstadoM" type="text" name="txtNome" value="" runat="server" /></p>
            <p><span>País:</span><input id="txtPaisM" type="text" name="txtNome" value="" runat="server" /></p>
            <p><span>CEP:</span><input id="txtCEPM" type="text" name="txtNome" value="" runat="server" /></p>
            <p style="padding-top: 15px"><span>&nbsp;</span>
            
            <asp:Button CssClass="submit" ID="btnSalvarM" Text="Salvar" runat="server" 
                    onclick="btnSalvarM_Click" />
            </p>
          </div>
        <div>
        <center>
        <br />
        <asp:GridView ID="Gridv" runat="server" ShowHeaderWhenEmpty="True" runat="server">
        </asp:GridView>
        <br />
        </center>
        </div>
        </form>
        
      </div>
    </div>
    <footer>
      <p>Copyright &copy; InfoWell | <a href="http://www.css3templates.co.uk" target="_blank">design from css3templates.co.uk</a></p>
    </footer>
  </div>
  <p>&nbsp;</p>
  <!-- javascript at the bottom for fast page loading -->
  <script type="text/javascript" src="js/jquery.js"></script>
  <script type="text/javascript" src="js/jquery.easing-sooper.js"></script>
  <script type="text/javascript" src="js/jquery.sooperfish.js"></script>
  <script type="text/javascript">
      $(document).ready(function () {
          $('ul.sf-menu').sooperfish();
      });




  </script>
</body>
</html>
<script type="text/javascript">
//(function($){
function CarregaGrid(){
//        $.ajax({
//            type: "POST",
//            url: "Motoristas.aspx/GetMotoristas",
//            data: "{}",
//            contentType: "application/json",
//            dataType: "json",
//            success: function (data) {
//                for (var i = 0; i < data.d.length; i++) {
//                    $("#data-grid-local").append("<tr><td>" + data.d[i].Nome +
//                                            "</td><td>" + data.d[i].CPF + "</td></tr>");
//                }
//            }
    //        })
            var oColunas = [{ display: 'id',         name: 'id_motorista',    width: 250,     sortable: true, align: 'center'},
            { display: 'Nome',         name: 'nome',    width: 250,     sortable: true, align: 'center'},
            { display: 'CPF',         name: 'CPF',    width: 250,     sortable: true, align: 'center'},

                            ];
            
//            var params = [
//                            { name: 'CodigoCobertura', value: $('#CodigoCobertura').val() },
//                            { name: 'CodigoGrupoSusep', value: $('#CodigoGrupoSusep').val() },
//                            { name: 'CodigoRamoSusep', value: $('#CodigoRamoSusep').val() },
//                         ];

            var config = { url: "Motoristas.aspx/GetMotoristas",
                metodo: 'POST',
                ordemPadrao: '',
                titulo: 'Resultado',
                colunas: oColunas,
                width: 1030,
                height: 231, 
                rowAlign: 'left',
                cursorIcon: '1'
            };

            carregarGrid('#data-grid-local', null, config);
            //            $('#divGrid').show();
}
    //})
</script>
<script language="javascript">
    (function ($) {
                $.ajax({
                    type: "POST",
                    url: "Motoristas.aspx/GetMotoristas",
                    data: "{}",
                    contentType: "application/json",
                    dataType: "json",
                    success: function (data) {
                        for (var i = 0; i < data.d.length; i++) {
//                            $("#data-grid-local").append("<tr><td>" + data.d[i].Nome +
                            //                                                    "</td><td>" + data.d[i].CPF + "</td></tr>");
                            
                        }
                    }
                })
        var $dgLocal = $('#data-grid-local')

        $dgLocal.datagrid({
            jsonStore: {
                data: { "rows": [
                { "id": "1", "nome": "Fulano de Tal", "empresa": "Empresa 1" }
                , { "id": "2", "nome": "Beltrano da Silva", "empresa": "Empresa 2" }
                , { "id": "3", "nome": "Beltrano da Silva", "empresa": "Empresa do tal" }
                , { "id": "4", "nome": "Beltrano da Silva", "empresa": "Empresa 123122" }
                , { "id": "5", "nome": "Beltrano da Silva", "empresa": "Empresa 2" }
                , { "id": "6", "nome": "Beltrano da Silva", "empresa": "Empresa 3312" }
                , { "id": "7", "nome": "Beltrano da Silva", "empresa": "Empresa 312" }
                , { "id": "8", "nome": "Beltrano da Silva", "empresa": "Empresa 3123122" }
                , { "id": "9", "nome": "Fulano de Tal", "empresa": "Empresa 221" }
                , { "id": "10", "nome": "Beltrano da Silva", "empresa": "Empresa 2" }
                , { "id": "11", "nome": "Beltrano da Silva", "empresa": "Empresa 3123122" }
                , { "id": "12", "nome": "Beltrano da Silva", "empresa": "Empresa 2" }
                , { "id": "13", "nome": "Beltrano da Silva", "empresa": "Empresa 2" }
                , { "id": "14", "nome": "Beltrano da Silva", "empresa": "Empresa 2" }
                , { "id": "15", "nome": "Beltrano da Silva", "empresa": "Empresa 2" }
                , { "id": "16", "nome": "Beltrano da Silva", "empresa": "Empresa 2" }
                , { "id": "17", "nome": "Fulano de Tal", "empresa": "Empresa 2" }
                , { "id": "18", "nome": "Beltrano da Silva", "empresa": "Empresa 1232" }
                , { "id": "18", "nome": "Beltrano da Silva", "empresa": "Empresa 2" }
                , { "id": "20", "nome": "Fulano de Tal", "empresa": "Empresa 2" }
                , { "id": "21", "nome": "Beltrano da Silva", "empresa": "Empresa23 2" }
                , { "id": "22", "nome": "Beltrano da Silva", "empresa": "Empresa 2" }
                , { "id": "23", "nome": "Fulano de Tal", "empresa": "Empresa 1233332" }
            ]
                }
            }
        , pagination: false
        , mapper: [{
            name: 'id', alias: 'Código', css: { width: 50, textAlign: 'center' }
        }, {
            name: 'nome', alias: 'Nome', css: { width: 200, textAlign: 'left' }
        }, {
            name: 'empresa', alias: 'Empresa', css: { textAlign: 'left' }
        }]
        })

    })(jQuery)
</script

--%>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentRoteirizacao" runat="server">
    <div id="site_content">
      <div class="content">
        <h2>Cadastro Motorista</h2>
        <form id="Form1" action="#" method="post" runat="server">

                  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
        <script type="text/javascript" src="js/jquery.ui.datagrid.min.js"></script>
          <div class="form_settings">
            <p><span>Nome:</span><input type="text" id="txtNome" name="txtNome" value="" runat="server" /></p>
            <p><span>RG:</span><input id="txtRG" type="text" name="txtNome" value="" runat="server" /></p>
            <p><span>CPF:</span><input id="txtCPF" type="text" name="txtNome" value="" runat="server" /></p>
            <p><span>CNH:</span><input id="txtCNH" type="text" name="txtNome" value="" runat="server" /></p>
            <p><span>CNH Cat.:</span><input id="txtCatCNH" type="text" name="txtNome" value="" runat="server" /></p>
            <p><span>Rua:</span><input id="txtRuaM" type="text" name="txtNome" value="" runat="server" /></p>
            <p><span>Nº:</span><input id="txtNumM" type="text" name="txtNome" value="" runat="server" /></p>
            <p><span>Complemento:</span><input id="txtCompM" type="text" name="txtNome" value="" runat="server" /></p>
            <p><span>Bairro:</span><input id="txtBairroM" type="text" name="txtNome" value="" runat="server" /></p>
            <p><span>Cidade:</span><input id="txtCidadeM" type="text" name="txtNome" value="" runat="server" /></p>
            <p><span>Estado:</span><input id="txtEstadoM" type="text" name="txtNome" value="" runat="server" /></p>
            <p><span>País:</span><input id="txtPaisM" type="text" name="txtNome" value="" runat="server" /></p>
            <p><span>CEP:</span><input id="txtCEPM" type="text" name="txtNome" value="" runat="server" /></p>
            <p style="padding-top: 15px"><span>&nbsp;</span>
            
            <asp:Button CssClass="submit" ID="btnSalvarM" Text="Salvar" runat="server" 
                    onclick="btnSalvarM_Click" />
            </p>
          </div>
        <div>
        <center>
        <br />
        <asp:GridView ID="Gridv" runat="server" ShowHeaderWhenEmpty="True" runat="server">
        </asp:GridView>
        <br />
        </center>
        </div>
        </form>
        
      </div>
    </div>
</asp:Content>